package com.breakfast.fun.data.entity.home;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.io.Serializable;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * 周套餐
 * Created by Administrator on 2016/8/18.
 */
public class Products implements Serializable {

    /**
     * categoryName : 周一
     * categoryId : 21
     * date : 2016-08-15
     * product : {}
     */

    private String categoryName;
    private int categoryId;
    private String date;
    private Product product;

    public static Products objectFromData(String str) {

        return new Gson().fromJson(str, Products.class);
    }

    public static List<Products> arrayProductsFromData(String str) {

        Type listType = new TypeToken<ArrayList<Products>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public int getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(int categoryId) {
        this.categoryId = categoryId;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

}
